<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fuck" uri="/pager-tags" %>
<html>

<head>
	<meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
	<title>课程机构列表 - 慕学在线网</title>
	<link rel="stylesheet" type="text/css" href="../../css/reset.css">
	<link rel="stylesheet" type="text/css" href="../../css/animate.css">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
    <link rel="stylesheet" type="text/css" href="../../css/pager.css">
    <link rel="stylesheet" type="text/css" href="../../css/css.css">
    
    <script src="../../js/jquery.min.js" type="text/javascript"></script>
    <script src="../../js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

    <script src="../../js/jquery.min.js" type="text/javascript"></script>
    <script src="../../../js/message.js" type="text/javascript"></script>
    <script src="../../js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var ctx = "${sessionScope.user_session}";
    </script>
</head>
<body onload="setTimeout('getcount()',1000)">
<section class="headerwrap ">
    <header>
		<div  class=" header">
 			<div class="top">
				<div class="wp">
					<div class="fl"><p>服务电话：<b>13280797579</b></p></div>
					<!--登录后跳转-->
                    <c:choose>
                        <c:when test="${sessionScope.user_session!=null}">
                            <div class="personal">
                                <dl class="user fr">
                                    <dd>${sessionScope.user_session.username}<img class="down fr" src="${pageContext.request.contextPath}/images/top_down.png"/></dd>
                                    <dt><img width="20" height="20" src="${pageContext.request.contextPath}${sessionScope.user_session.image}"/></dt>
                                </dl>
                                <div class="userdetail">
                                    <dl>
                                        <dt><img width="80" height="80" src="${pageContext.request.contextPath}${sessionScope.user_session.image}"/></dt>
                                        <dd>
                                            <h2>${sessionScope.user_session.username}</h2>
                                            <p>用户</p>
                                        </dd>
                                    </dl>
                                    <div class="btn">
                                        <a class="personcenter fl" href="${pageContext.request.contextPath}/usercenter">进入个人中心</a>
                                        <a class="fr" href="${pageContext.request.contextPath}/logout">退出</a>
                                    </div>
                                </div>
                            </div>
                        </c:when>
                        <c:otherwise>
                            <a style="color:white" class="fr registerbtn" href="/register">注册</a>
                            <a style="color:white" class="fr loginbtn" href="${pageContext.request.contextPath}/login">登录</a>
                        </c:otherwise>
                    </c:choose>

                    


				</div>
			</div>

            <div class="middle">
                <div class="wp">
                    <a href="/index"><img class="fl" src="../../images/logo.jpg"/></a>
                    <div class="searchbox fr">
                        <div class="selectContainer fl">
                            <span class="selectOption" id="jsSelectOption" data-value="course">
                                公开课
                            </span>
                            <ul class="selectMenu" id="jsSelectMenu">
                                <li data-value="course">公开课</li>
                                <li data-value="org">课程机构</li>
                                <li data-value="teacher">授课老师</li>
                            </ul>
                        </div>
                        <input id="search_keywords" class="fl" type="text" value="" placeholder="请输入搜索内容"/>
                        <img class="search_btn fr" id="jsSearchBtn" src="../../images/search_btn.png"/>
                    </div>
                </div>
            </div>
            
            
			<nav>
				<div class="nav">
					<div class="wp">
						<ul>
							<li ><a href="/index">首页</a></li>
							<li >
								<a href="/course-list">
									公开课<img class="hot" src="../../images/nav_hot.png">
								</a>
							</li>
							<li >
								<a href=/showTeacherList">授课教师</a>
							</li>
							<li class="active" ><a href=/org_list">授课机构</a></li>
						</ul>
					</div>
				</div>
			</nav>
            
			</div>
    </header>
</section>
<!--crumbs start-->

    <section>
        <div class="wp">
            <ul  class="crumbs">
                <li><a href="/index">首页</a>></li>
                <li>课程机构</li>
            </ul>
        </div>
    </section>


<section>
	<div class="wp butler_list_box list">
	<div class='left'>
		<div class="listoptions">
			<ul>
				<li>
					<h2>机构类别</h2>
					<div class="cont">
                        <a href="?city=${requestScope.city}"><span <c:if test="${requestScope.ct==null||requestScope.ct==''}">class="active2"</c:if>>全部</span></a>

                            <a href="?ct=pxjg&city=${requestScope.city}"><span <c:if test="${requestScope.ct=='pxjg'}">class="active2"</c:if>>培训机构</span></a>

                            <a href="?ct=gx&city=${requestScope.city}"><span <c:if test="${requestScope.ct=='gx'}">class="active2"</c:if>>高校</span></a>

                            <a href="?ct=gr&city=${requestScope.city}"><span <c:if test="${requestScope.ct=='gr'}">class="active2"</c:if>>个人</span></a>

					</div>
				</li>
				<li>
					<h2>所在地区</h2>
					<div class="more">更多</div>
					<div class="cont">
                        <a href="?ct=${requestScope.ct}"><span <c:if test="${requestScope.city==null}">class="active2"</c:if>>全部</span></a>
                            <c:forEach items="${requestScope.city_list}" var="city">
                                <a href="?city=${city.id}&ct=${requestScope.ct}"><span <c:if test="${requestScope.city==city.id}">class="active2"</c:if>>${city.name}市</span></a>
                            </c:forEach>

                            
					</div>
				</li>
			</ul>
		</div>
		<div class="all">共<span class="key">
            <c:choose>
                <c:when test="${requestScope.city==null && (requestScope.ct==null||requestScope.ct=='')}">
                    ${requestScope.counts2}
                </c:when>
                <c:otherwise>
                    ${requestScope.counts}
                </c:otherwise>
            </c:choose>
        </span>家</div>
		<div class="butler_list company list">
		<div class="layout">
			<div class="head">
				<ul class="tab_header">
					<li <c:if test="${requestScope.sort==null||requestScope.sort==''}">class="active"</c:if>><a href="?ct=&city=">全部</a> </li>
					<li <c:if test="${requestScope.sort=='students'}">class="active"</c:if>><a href="?sort=students&ct=${requestScope.ct}&city=${requestScope.city}">学习人数 &#8595;</a></li>
					<li <c:if test="${requestScope.sort=='courses'}">class="active"</c:if>><a href="?sort=courses&ct=${requestScope.ct}&city=${requestScope.city}">课程数 &#8595;</a></li>
				</ul>
			</div>
            <c:forEach items="${requestScope.org_list}" var="org">
                <dl class="des difdes">
                    <dt>
                        <a href="${pageContext.request.contextPath}/org_home?id=${org.id}">
                            <img width="200" height="120" class="scrollLoading" src="${org.image}"/>
                        </a>
                    </dt>
                    <dd>
                        <div class="clearfix">
                            <a href="${pageContext.request.contextPath}/org_home?id=${org.id}">
                                <h1>${org.name}</h1>
                                <div class="pic fl">

                                    <img src="../../images/authentication.png"/>

                                    <img src="../../images/gold.png"/>

                                </div>
                            </a>
                        </div>
                        <ul class="cont">
                            <li class="first"><p class="pic9">课程数：${fn:length(org.courses)}<span></span></p><p class="c7">学习人数：<span>${org.click_nums}</span></p></li>
                            <li class="c8" style="padding-left:18px;">${org.address}</li>
                            <li class="pic10" style="padding-left:18px;">经典课程：
                            <c:forEach items="${org.courses}" var="course">
                                <a href="/course?id=${course.id}">${course.name}</a>
                            </c:forEach>

                            </li>
                        </ul>
                    </dd>
                    <div class="buy start_groupbuy jsShowPerfect2" data-id="22"><br/>联系<br/>服务</div>
                </dl>
            </c:forEach>
		</div>
            <div style="margin-top: 60px"><fuck:pager
                    pageIndex="${requestScope.pageModel.pageIndex}"
                    pageSize="${requestScope.pageModel.pageSize}"
                    recordCount="${requestScope.pageModel.recordCount}"

                    submitUrl="${pageContext.request.contextPath}/org_list?pageIndex={0}&city=${requestScope.city}&ct=${requestScope.ct}"/></div>

		</div>
	</div>
	<div class="right companyright">
			<div class="head">我要学习</div>
			<form class="rightform" id="jsStayForm">
				<div>
                    <img src="../../images/rightform1.png"/>
                    <input type="text" name="name" id="companyName" placeholder="名字" maxlength="25" />
                </div>
				<div>
                    <img src="../../images/rightform2.png"/>
                    <input type="text" name="mobile" id="companyMobile" placeholder="联系电话"/>
                </div>
				<div>
                    <img src="../../images/rightform3.png"/>
                    <input type="text" name="course_name" id="companyAddress" placeholder="课程名" maxlength="50" />
                </div>
                <p class="error company-tips" id="jsCompanyTips"></p>
				<input class="btn" type="text" id="jsStayBtn" value="立即咨询 >" />
            <input type='hidden' name='csrfmiddlewaretoken' value='5I2SlleZJOMUX9QbwYLUIAOshdrdpRcy' />
            </form>
		</div>

		<div class="right companyrank layout">
			<div class="head">授课机构排名</div>

            <c:forEach items="${requestScope.top4}" var="top4" varStatus="status">
                <dl class="des">
                    <dt class="num fl">${status.index+1}</dt>
                    <dd>
                        <a href="/org_home?id=${top4.id}"><h1>${top4.name}</h1></a>
                        <p>${top4.city.name}市</p>
                    </dd>
                </dl>
            </c:forEach>




		</div>
        </div>
</section>

<footer>
		<div class="footer">
			<div class="wp">
				<ul class="cont">
					<li class="logo"><a href=""><img src="../../images/footlogo.png"/></a></li>
					<li class="code"><img src="../../images/code.jpg"/><p class="center">扫描关注微信</p></li>
					<li class="third"><img class="fl" src="../../images/tell.png"/><p class="tell">13280797579</p><p class="time">周一至周日 9:00-18:00</p></li>
				</ul>

			</div>
			<p class="line"></p>
			<div class="wp clear">
                <span class="fl">? 2016 www.projectsedu.com 慕学在线-在线学习交流平台 保留所有权利</span>
                <span class="fr">copyright ? 2016 ICP备案证书号：蜀ICP备xxxxx号-1</span>
			</div>
		</div>
	</footer>

<section>
    <ul class="sidebar">
        <li class="qq">
            <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2023525077&site=qq&menu=yes"></a>
        </li>
        <li class="totop"></li>
    </ul>
</section>
<script src="../../js/selectUi.js" type='text/javascript'></script>
<script src="../../js/deco-common.js" type='text/javascript'></script>
<script type="text/javascript" src="../../js/plugins/laydate/laydate.js"></script>
<script src="../../js/plugins/layer/layer.js"></script>
<script src="../../js/plugins/queryCity/js/public.js" type="text/javascript"></script>
<script src="../../js/unslider.js" type="text/javascript"></script>
<script src="../../js/plugins/jquery.scrollLoading.js"  type="text/javascript"></script>
<script src="../../js/deco-common.js"  type="text/javascript"></script>

<script>
    $(function(){
        $('#jsStayBtn').on('click', function(){
            var name = $('#companyName').val();
            var mobile = $('#companyMobile').val();
            var course = $('#companyAddress').val();
            $.ajax({
                type: "POST",
                url:"/org/add_ask",
                data:JSON.stringify({name:name,mobile:mobile,course_name:course}),
                contentType:"application/json;charset=utf-8",
                success: function(data) {
                    if(data!=null){
                        $('#jsStayForm')[0].reset();
                        alert("提交成功")
                    }else {
                        $('#jsCompanyTips').html("提交失败")
                    }
                },
            });
        });
    })

</script>

</body>
</html>
